import {
  request
} from '../utils/request';

let getUserInfo = () => {
  return request({
    url: '/userInfo'
  });
}

let editUserInfo = (data = {}) => {
  return request({
    url: '/edit/userInfo',
    method: 'POST',
    header: {
      'Content-Type': 'application/json'
    },
    data: {
      ...data
    }
  });
}

let getFeedback = () => {
  return request({
    url: '/feedback/category/list'
  });
}

let submitFeedback = (feedbackLabel, content, images, link) => {
  return request({
    url: '/feedback/add',
    method: 'POST',
    data: {
      feedbackLabel: feedbackLabel,
      content: content,
      images: images,
      link: link
    }
  });
}

module.exports = {
  getUserInfo,
  editUserInfo,
  getFeedback,
  submitFeedback
}